[K8s] Clean up terminated driver pods on informer add - #7632
Open
ruanwenjun wants to merge 1 commit into
Open
Conversation
ruanwenjun
marked this pull request as ready for review
August 14, 2026 02:54
ruanwenjun
force-pushed
the
fix-k8s-terminated-pod-on-add
branch
from
August 14, 2026 06:06
21f9152 to
f5bb357
Compare
- Handle terminated applications in SparkEnginePodEventHandler.onAdd. - Remove cleanTerminatedAppPodsOnKubernetesClientInitialize and its executor.
ruanwenjun
force-pushed
the
fix-k8s-terminated-pod-on-add
branch
from
August 14, 2026 06:12
f5bb357 to
c4c3a03
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
At startup, Kyuubi uses a separate one-time LIST to find and clean terminated driver pods. A pod can be missed if this LIST fails, or if it completes after the cleanup LIST observes it as running but is first reported by the informer as an ADD event. Since
onAddonly records state and does not schedule cleanup, the pod may receive no further update and therefore remain in memory and not be deleted even when the cleanup strategy isALL.The informer already lists existing pods during initialization. Handling terminated pods in
onAddcloses both gaps and makes the separate cleanup LIST unnecessary.How was this patch tested?
Added
mark terminated application received from pod add eventto verify that a succeeded Spark driver pod received through ADD is registered in the terminated-application cleanup trigger. The test fails without the production change and passes with it.Was this patch authored or co-authored using generative AI tooling?
Yes, using Codex: GPT-5